package PPJ;

public class Zad29 {

	public static void main(String[] args) {
		
		Counter c = new Counter();
		
		System.out.println(c.state());
		//0
		c.inc();
		c.inc();
		System.out.println(c.state());
		//2
		c.inc();
		System.out.println(c.state());
		//3
		c.dec();
		System.out.println(c.state());
		//2
		c.reset();
		System.out.println(c.state());
		//0
		System.out.println(Counter.getOp());
		//10
		
	}

}

class Counter {
	private int state;
	private static int op=0;

	public Counter() {
		state = 0;
	}
	
	public int state(){
		op++;
		return state; }
	
	 public int inc(){
		 op++;
		 state=state+1;
		return state;
	 }
	 
	 public int dec(){
		 op++;
		 state=state-1;
		 return state;
	 }
	 

	 public void reset(){
		 op++;
		 state=0;
	 }
	 
	 static int getOp(){
		 return op;
	 }
	 
	 
}